package huanzhao.erp.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import huanzhao.erp.domain.types.CommentType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

@TableName(value ="comment")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Comment implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 备注时间
     */
    @TableField(value = "time")
    private Date time;

    /**
     * 手机id
     */
    @TableField(value = "phone_id")
    private Long phoneId;


    @TableField(value = "type")
    private CommentType type;

    /**
     * 备注内容
     */
    @TableField(value = "content")
    private String content;

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public Comment(Long phoneId, CommentType type, String content) {
        this.phoneId = phoneId;
        this.type = type;
        this.content = content;
    }
}